//-----------------------------------------------------------------------
// <copyright file="EmailReceivedEventArgs.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Microsoft.Live.Messenger
{
    using System;
    using Microsoft.Live.Core;

    /// <summary>
    /// Represents the method that will handle the <see cref="Mailbox.EmailReceived"/> event of the <see cref="Mailbox"/>.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">An <see cref="EmailReceivedEventArgs"/> object that contains the event data.</param>
    public delegate void EmailReceivedEventHandler(object sender, EmailReceivedEventArgs e);

    /// <summary>
    /// Provides data for the <see cref="Mailbox.EmailReceived"/> event of <see cref="Mailbox"/>.
    /// </summary>
    public class EmailReceivedEventArgs : EventArgs
    {
        private readonly string subject;
        private readonly string sender;
        private readonly string senderAddress;
        private readonly Uri messageUrl;
        private readonly MailFolder folder;

        /// <summary>
        /// Initializes a new instance of the <see cref="EmailReceivedEventArgs"/> class.
        /// </summary>
        /// <param name="subject">The subject of the email.</param>
        /// <param name="sender">The sender of the email.</param>
        /// <param name="senderAddress">The address of the sender of the email.</param>
        /// <param name="messageUrl">The URL of the email.</param>
        /// <param name="folder">The folder</param>
        public EmailReceivedEventArgs(
            string subject,
            string sender,
            string senderAddress,
            Uri messageUrl,
            MailFolder folder)
        {
            this.subject = subject;
            this.sender = sender;
            this.senderAddress = senderAddress;
            this.messageUrl = messageUrl;
            this.folder = folder;
        }

        /// <summary>
        /// Gets the subject of the email.
        /// </summary>
        public string Subject
        {
            get { return this.subject; }
        }

        /// <summary>
        /// Gets the sender of the email.
        /// </summary>
        public string Sender
        {
            get { return this.sender; }
        }

        /// <summary>
        /// Gets the address of the sender of the email.
        /// </summary>
        public string SenderAddress
        {
            get { return this.senderAddress; }
        }

        /// <summary>
        /// Gets the URL of the email.
        /// </summary>
        public Uri MessageUrl
        {
            get { return this.messageUrl; }
        }

        /// <summary>
        ///     The folder the email ended up in.
        /// </summary>
        public MailFolder Folder
        {
            get { return this.folder; }
        }
    }
}
